﻿using System;
using System.Windows.Data;

namespace TaskManager
{
    /// <summary>
    /// This converter is used for converting the Priority of a Process into 
    /// a Color which can be displayed in the ListView
    /// </summary>
    class PriorityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {

            if ((int)value >= 13)
            {
                return "Red"; //Very High
            }
            if ((int)value > 8 && (int)value < 13)
            {
                return "Orange"; //Medium High
            }
            else if ((int)value <= 8 && (int)value > 4)
            {
                return "Green"; //Normal
            }
            else if ((int)value <= 4)
            {
                return "Cyan"; //Idle
            }
            else return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }


    }
}
